import Vue from 'vue'
import vueRouter from 'vue-router'
// 引入组件
import sports from '@/components/02-体育人生/sports'
import sportsHome from '@/components/02-体育人生/home'
import sportsNews from '@/components/02-体育人生/news'
import notfund from '@/components/404'

// 子组件
import spHomeCom from '@/components/02-体育人生/子组件/sportshomeCom'
import spForeignCom from '@/components/02-体育人生/子组件/sportsForeignCom'
import spChinaCom from '@/components/02-体育人生/子组件/sportsChinaCom'
// 使用
Vue.use(vueRouter)
//路由实例
const route = new vueRouter({
    routes:[
        {
            path:'/',
            redirect: '/sportsHome'
        },
        {
            path:'/sports',
            component:sports,
            children:[
                {
                    path:'/sports/home',
                    component:spHomeCom
                },
                {
                    path:'/sports/china',
                    component:spChinaCom
                },
                {
                    path:'/sports/foreign',
                    component:spForeignCom
                },
                

            ]

        },
        {
            path:'/sportsHome',
            component:sportsHome
           
        },
        {
            path:'/sportsNews',
            component:sportsNews
        },
        {
            path: '*',
            component: notfund
        }
    ]
})
export default route

